Fix compilation error on ESP32C3#424
Merged
Merged
Conversation
|
I was just going to submit the same PR. Glad to see you made this! |
lucasmontec
approved these changes
Sep 10, 2025
lucasmontec
left a comment
There was a problem hiding this comment.
I tested the same exact fix in my setup and this compiles correctly.
Member
|
I am ok with this fix. However, I just wish there was a more generic flag we could rely on. It would be more future-proof if we could say "if has one I2C interface then this, else that". Having to rely on chip names likely means that we'll have to extend the condition to other chips in the future. I'll need to look into the CI build failures. |
Member
Indeed, it appears it's same for the C6: meshtastic#16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the issue #419 & #370 when using the library targeting an ESP32C3 which has only one i2c interface.
The original code has a compilation directive for ESP32 to allow using
WireorWire1interface butWire1is not present in the SDK of the ESP32C3, resulting in a compilation error.In the issue #419 it was suggested to adapt the constructor by passing the bus as argument but I could not find a way to pass it and setting a specific geometry.
This solution uses the constant
CONFIG_IDF_TARGET_ESP32C3to prevent the use ofWire1.Tested on y program on which the build failed, now build and runs perfectly.
I implemented the fix for SSD1306 class because I use this kind of display, but I did the same for SH1106 class, without being able to test it.